package org.association.entity;


import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import nonapi.io.github.classgraph.json.Id;
import org.association.dto.NormalProposalDTO;

import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;

@Data
@TableName("t_normal_proposal")
public class NormalProposal{
    private String proposalName;
    private String activityPlace;
    private String activityContent;
    private String activityBudgetList;
    private Date publishTime;
    private BigDecimal activityBudgetSum;
    private String publishUserId;
    private int organizationId;
    @Id
    private String proposalId;
    private Long agreePeopleSum = new Long(0);

    private Long targetPeopleSum = new Long(0);

    private Long disagreePeopleSum = new Long(0);

    /**
     * 0 表示未完成
     * 1 表示完成
     */
    private int isExecuted = 0;

    public NormalProposal(){}

    public NormalProposal(NormalProposalDTO normalProposalDTO){
        proposalName = normalProposalDTO.getProposalName();
        activityPlace = normalProposalDTO.getActivityPlace();
        activityBudgetList = normalProposalDTO.getActivityBudgetList();
        publishTime = new Date();
        activityBudgetSum = normalProposalDTO.getActivityBudgetSum();
        publishUserId = normalProposalDTO.getPublishUserID();
        organizationId = normalProposalDTO.getOrganizationID();
        proposalId = UUID.randomUUID().toString();
        activityContent = normalProposalDTO.getActivityContent();
    }
}
